package nl.hro.mobiqueen.ui;

import android.database.Cursor;
import android.graphics.Color;
import nl.hro.mobiqueen.R;
import android.os.Bundle;
import android.view.View;
import nl.hro.mobiqueen.data.DatabaseAdapter;

public class Instellingen extends MobiBase {

        private DatabaseAdapter DA;

	@Override
	public void onCreate(Bundle mobi) {
		super.onCreate(mobi);

		setContentView(R.layout.instellingen);

                DA = new DatabaseAdapter(this);
                DA.open();
	}

        private void updateFavorite(String favorite)
        {
            Cursor c = DA.findFavoriteByName(favorite);
            if (c.getCount() == 0)
            {
                DA.clearFavorites();
                DA.insertFavorite(favorite, 1);
            }
            else
            {
                DA.toggleFavorite(favorite);
            }
        }

        public void dance(View view) {
            // Dance
            updateFavorite("dance");
        }

        public void pop(View view) {
            // Pop
            updateFavorite("pop");
        }

        public void hiphop(View view) {
            // HipHop
            updateFavorite("hiphop");
        }

        public void rock(View view) {
            // Rock
            updateFavorite("rock");
        }

        public void nederlands(View view) {
            // Nederlands
            updateFavorite("nederlands");
        }
}